package com.jiang.factory;

import com.jiang.serviceproxy.ServiceProxy;

/**
 * @author Administrator
 *
 */
public abstract class ServiceFactory {

	@SuppressWarnings("unchecked")
	public static<T> T getInstance(Class<T> clz) {
		
		T t = null;
		try {
			 t = clz.newInstance();
			 return (T) new ServiceProxy().bind(t);
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return t;
	}
	
	
}
